import csv
import sys

class Fund:
  def __init__(self, row):
    self.symbol, self.name, self.shares, self.money, self.category, self.account = row
  def get(self):
    return (self.symbol, self.name, self.shares, self.money, self.category, self.account)                                                                                        

d = dict()

d['large_cap'] = 0
d['small_cap'] = 0
d['mid_cap'] = 0
d['foreign'] = 0
d['bond'] = 0
d['uncategorized'] = 0

with open(sys.argv[1], 'rb') as f:
    reader = csv.reader(f)
    headerline = reader.next() #skip first line bc its header                                                    
    funds = list(map(Fund, reader))

    for f in funds:
      if "large" in f.category.lower():
        d['large_cap'] = d['large_cap'] + float(f.money.strip('$'))
      elif "small" in f.category.lower():
        d['small_cap'] = d['small_cap'] + float(f.money.strip('$'))
      elif "foreign" in f.category.lower():
        d['foreign'] = d['foreign'] + float(f.money.strip('$'))
      elif "bond" in f.category.lower():
        d['bond'] = d['bond'] + float(f.money.strip('$'))
      elif "mid" in f.category.lower():
        d['mid_cap'] = d['mid_cap'] + float(f.money.strip('$'))
      else:
        d['uncategorized'] = d['uncategorized'] + float(f.money.strip('$'))

    d['mid_cap'] += 5000

for (k, v) in d.items():
  print "[{0}: {1:f}]".format(k, (v / sum(d.values())))